﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;

using System.Text;
using System.Windows.Forms;
using DevComponents.DotNetBar;

namespace QUANLYCHAMCONG.PL.CMS
{
    public partial class QuickBar : UserControl
    {
        public delegate void _Home();
        public event _Home Home;
        public delegate void _Nhanvien();
        public event _Nhanvien Nhanvien;
        public delegate void _Chamcong();
        public event _Chamcong ChamCong;
        public delegate void _TangCa();
        public event _TangCa TangCa;
        public delegate void _DangKyMay();
        public event _DangKyMay DangKyMay;
        public delegate void _KetNoiMayChamCong();
        public event _KetNoiMayChamCong KetNoiMayChamCong;
        public delegate void _DanhMuc();
        public event _DanhMuc DanhMuc;
        public delegate void _BaoCao();
        public event _BaoCao BaoCao;
        public delegate void _PhanQuyen();
        public event _PhanQuyen PhanQuyen;
        public delegate void _ChangePass();
        public event _ChangePass ChangePass;
        public delegate void _Database();
        public event _Database Database;
        public DataTable Dt;
        public QuickBar()
        {
            InitializeComponent();
        }
        private void btndsnhanvien_Click(object sender, DevComponents.DotNetBar.ClickEventArgs e)
        {
            if (this.Nhanvien != null)
                this.Nhanvien();
        }

        private void btnchamcong_Click(object sender, DevComponents.DotNetBar.ClickEventArgs e)
        {
            if (this.ChamCong != null)
                this.ChamCong();
        }

        private void btntangca_Click(object sender, DevComponents.DotNetBar.ClickEventArgs e)
        {
            if (this.TangCa != null)
                this.TangCa();
        }

        private void btndkmcc_Click(object sender, DevComponents.DotNetBar.ClickEventArgs e)
        {
            if (this.DangKyMay != null)
                this.DangKyMay();
        }

        private void btnketnoi_Click(object sender, DevComponents.DotNetBar.ClickEventArgs e)
        {
            if (this.KetNoiMayChamCong != null)
                this.KetNoiMayChamCong();
        }

        private void btndanhmuc_Click(object sender, DevComponents.DotNetBar.ClickEventArgs e)
        {
            if (this.DanhMuc != null)
                this.DanhMuc();
        }

        private void btnbaocao_Click(object sender, DevComponents.DotNetBar.ClickEventArgs e)
        {
            if (this.BaoCao != null)
                this.BaoCao();
        }

        private void btnphanquyen_Click(object sender, DevComponents.DotNetBar.ClickEventArgs e)
        {
            if (this.PhanQuyen != null)
                this.PhanQuyen();
        }

        private void btnhome_Click(object sender, DevComponents.DotNetBar.ClickEventArgs e)
        {
            if (this.Home != null)
                this.Home();
        }

        private void btnchangpass_Click(object sender, DevComponents.DotNetBar.ClickEventArgs e)
        {
            if (this.ChangePass != null)
                this.ChangePass();
        }

        private void btndatabase_Click(object sender, DevComponents.DotNetBar.ClickEventArgs e)
        {
            if (this.Database != null)
                this.Database();
        }
        public void Authen()
        {
            if (Dt.Rows.Count != 0)
            {
                foreach (DataRow dr in Dt.Rows)
                {
                    foreach (BubbleButton  btn in this.bubbleBarTab1.Buttons)
                    {
                        if (btn.Name.ToString() == dr["MENUVALUE"].ToString())
                        {
                            btn.Visible = true;
                        }
                    }
                }
            }
        }
       
    }
}
